Skip to content

Sync cloud integration on Authorization problems #4324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sergeibbb
Copy link
Member

@sergeibbb sergeibbb commented May 21, 2025

Description

Here we sync the cloud connected integration with GKDev when we face an authorization problem hoping that during the sync they respond us with the actual token.

If we see that we keep facing the same error we don't try to sync again. Instead we disconnect the integration soon letting user know that they need to take an action to reconnect.

Related to:

Follow-ups:

  • we'll need to create an issue to improve connecting failed cloud integrations back. Now it reconnects on "Sync" clicking, but it ignores click on the "socket plug" in the Remotes list.

Checklist

  • I have followed the guidelines in the Contributing document
  • My changes follow the coding style of this project
  • My changes build without any errors or warnings
  • My changes have been formatted and linted
  • My changes include any required corresponding changes to the documentation (including CHANGELOG.md and README.md)
  • My changes have been rebased and squashed to the minimal number (typically 1) of relevant commits
  • My changes have a descriptive commit message with a short title, including a Fixes $XXX - or Closes #XXX - prefix to auto-close the issue that your PR addresses

@sergeibbb sergeibbb changed the title Sync cloud integration on Authorizatin problems Sync cloud integration on Authorization problems May 21, 2025
@sergeibbb sergeibbb force-pushed the sync-cloud-integration-on-auth-problems branch from eb468fa to fd28d05 Compare May 21, 2025 18:00
sergeibbb added a commit that referenced this pull request May 21, 2025
@sergeibbb sergeibbb requested a review from eamodio May 21, 2025 18:00
sergeibbb added a commit that referenced this pull request May 22, 2025
@sergeibbb sergeibbb force-pushed the sync-cloud-integration-on-auth-problems branch from fd28d05 to 500523d Compare May 22, 2025 11:27
sergeibbb added a commit that referenced this pull request May 23, 2025
@sergeibbb sergeibbb force-pushed the sync-cloud-integration-on-auth-problems branch from 500523d to 3ce2c47 Compare May 23, 2025 10:21
@sergeibbb sergeibbb requested a review from axosoft-ramint June 3, 2025 16:22
@sergeibbb sergeibbb force-pushed the sync-cloud-integration-on-auth-problems branch from 3ce2c47 to c962bd0 Compare June 3, 2025 16:56
@sergeibbb sergeibbb added this to the 17.2 milestone Jun 3, 2025
@sergeibbb sergeibbb self-assigned this Jun 3, 2025
Comment on lines +287 to +291
this.syncCountDueToRequestException++;
this._session = {
...this._session,
expiresAt: new Date(Date.now() - 1),
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a hypothetical scenario I want to check with you here.

Let's say I have a GitHub token which has the required scopes to get my current account but not the scopes to get PRs.

So, every time the Launchpad automatically fetches PRs (let's say, every 5 minutes), it first gets the current account, which succeeds (and also resets the sync count) and then it tries to get PRs and fails because of the scope issue, throws an AuthenticationError, and we force it to sync.

This would cause us to sync every time the Launchpad fetches PRs which would hit our backend pretty hard and probably is not the intention, but..is it possible? If we can confirm that I am worrying for nothing, I think we are ok to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants